<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<input type="button" value="点击按钮修改所有文本框的值" id="btn">
	<div id="box">
		<input type="text" value="我是文本框1">
		<input type="text" value="我是文本框2">
		<input type="text" value="我是文本框3">
	</div>

 

	<script>

		var btn = document.getElementById('btn');
		var box = document.getElementById('box');
		// var inputs = box.children.value;
		var inputs = document.getElementsByTagName("input");

		btn.onclick = function(){
			for(var i= 0;i<inputs.length;i++){
				// console.log(inputs[i])
				inputs[i].value = "我是后来修改的值！"
			}
		}

	</script>
</body>
</html>